<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of dbtransction
 * 
 * @author Bumoni
 */
class dbtransction 
{
    public $fname;
    public $email;
    public $pwd;
    public $link;
    public $id;
    private $tm;
    private $st;
    
    /* this method inserts a new user record*/
    function insert_user_normal()
    {
        /* security check*/
        $this->email=addslashes(strip_tags($this->email));
        $this->pwd=addslashes(strip_tags($this->pwd));
        $this->fname=addslashes(strip_tags($this->fname));
        
        /*creating a id for the user usuing timestamp*/
        $t_id=uniqid(rand(),true);
        $this->id=md5($t_id);
        
        $this->tm=time(); //current unix timestamp
        
        $temp=database::query("insert into user (id,email,pwd,link,fullname,timestamp) values ('$this->id','$this->email','$this->pwd','$this->link','$this->fname','$this->tm')");
        return $this->id; //returning the user id
    }
    
    /* this method returns all the information about a user from user id */
    function get_user()
    {
        
    }
    
}

?>
